package com.ruoyi.web.controller.mall.orderComent.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.controller.mall.orderComent.domain.OrderComent;
import com.ruoyi.web.controller.mall.orderComent.service.IOrderComentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 评价Controller
 * 
 * @author ruoyi
 * @date 2021-01-18
 */
@RestController
@RequestMapping("/mall/orderComent")
public class OrderComentController extends BaseController
{
    @Autowired
    private IOrderComentService orderComentService;

    /**
     * 查询评价列表
     */
//    @RequiresPermissions("mall:orderComent:list")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody Map<String,Object> map)
    {
        startPage();
        List<Map<String,Object>> list = orderComentService.queryOrderComentList(map);
        return getDataTable(list);
    }

    /**
     * 导出评价列表
     */
//    @RequiresPermissions("mall:orderComent:export")
//    @Log(title = "评价", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    @ResponseBody
//    public AjaxResult export(OrderComent orderComent)
//    {
//        List<OrderComent> list = orderComentService.selectOrderComentList(orderComent);
//        ExcelUtil<OrderComent> util = new ExcelUtil<OrderComent>(OrderComent.class);
//        return util.exportExcel(list, "orderComent");
//    }

    /**
     * 修改保存评价
     */
//    @RequiresPermissions("mall:orderComent:edit")
//    @Log(title = "评价", businessType = BusinessType.UPDATE)
//    @PostMapping("/edit")
//    @ResponseBody
//    public AjaxResult editSave(OrderComent orderComent)
//    {
//        return toAjax(orderComentService.updateOrderComent(orderComent));
//    }

    /**
     * 删除评价
     */
//    @RequiresPermissions("mall:orderComent:remove")
//    @Log(title = "评价", businessType = BusinessType.DELETE)
//    @PostMapping( "/remove")
//    @ResponseBody
//    public AjaxResult remove(String[] ids)
//    {
//        return toAjax(orderComentService.deleteOrderComentByIds(ids));
//    }
}
